 function b = lagrange1(a, x, y)
	
	% valoare polinom Lagrange in a - metoda 2
	%Intrari:
	% a = abscisa in care se cere polinomul
	% x = abscisele celor n+1 puncte
	% y = ordonatele celor n+1 puncte
	%Iesiri:valoare polinom interpolare in a
	x
	y
	n = length(x);
	V =  a*( ~ eye(n)) - diag( x )*( ~ eye(n)) +eye(n)
	U = ones( n ) * diag( x ) - diag( x ) * ones( n ) + eye( n )
	b = prod( V ) ./ prod( U ) * y

endfunction
